package com.hgts.service.impl;

import com.hgts.common.R;
import com.hgts.pojo.Role;
import com.hgts.mapper.RoleMapper;
import com.hgts.service.IRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 凡哥哥
 * @since 2023-05-05
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Override
    public R<List<Role>> getRole() {
        List<Role> roleList = this.list();
        if (roleList == null) {
            return R.error("服务器异常");
        }
        return R.success(roleList);
    }
}
